JB> I know a lot of us use it, but BASIC encourages some bad programming practics, and ML won't allow you to bring the programming prcatices over. In addition, BASIC is like running, where ML is like taking baby steps.
I don't agree at all! Just because you can write unstructured programs in Basic does not mean you have to. I have always written very structured Basic programs and try to do the same thing in ML. Now I tend to structure my Basic with ML in mind, because I use Basic as test code before I code in ML. Anything goes in ML, so actually it is easier to code poorly in ML. Tricks the Kernal uses such as pushing return addresses on the stack and performing an rts, is considered bad form, but I now use that trick as conditions warrant it. I also use bit instructions to skip a byte or two, just like the Kernal does. That goes against how I was taught programming, but real world situations and solutions, sometimes means breaking the rules:) Comparing my style to other programmers though, I'm still very structured. People always want to blame Basic as a poor programming language, when it is actually just the poor programmers. My only complaint with Basic is the speed.
--------------------------------
Basic Command List
From : jopi@stekt.oulu.fi
Mark Rubin <mrubin@gallium.csusb.edu> writes:
Mark> I have a 128 but no manual. I know there are lots of commands in Basic 7 that aren't in Basic 2 (which I know). Does anybody know where a list of commands might be posted on the net? (or somewhere else?)
Ok... this time. The following list includes keywords from all known CBM Basics.
Listed below are keywords and token codes for all CBM Basic versions supported on petcat v1.9. They include the following:
Basic 1.0
Basic 2.0
Basic 2.0 with Super Expander
Basic 2.0 and Simon's Basic
Basic 2.0 with Speech Basic v2.7
Basic 4.0
Basic 4.0 extension for C64
Basic 3.5
Basic 7.0
Basic 10.0
COMMODORE BASIC KEYWORDS
Common Keywords (Tokens 80 - CB)
Tokens 80 to A2 represent action keywords, while codes B4 trough CA
are function keywords. AA - B3 are BASIC operators.
There is no GO (CB) on Basic 1.0.
Token Keyword
80 end
81 for
82 next
83 data
84 input#
85 input
86 dim
87 read
88 let
89 goto
8a run
8b if
8c restore
8d gosub
8e return
8f rem
90 stop
91 on
92 wait
93 load
94 save
95 verify
96 def
97 poke
98 print#
99 print
9a cont
9b list
9c clr
9d cmd
9e sys
9f open
a0 close
a1 get
a2 new
------------------
a3 tab(
a4 to
a5 fn
a6 spc(
a7 then
a8 not
a9 step
------------------
aa +
ab -
ac *
ad /
ae ^
af and
b0 or
b1 >
b2 =
b3 <
------------------
b4 sgn
b5 int
b6 abs
b7 usr
b8 fre
b9 pos
ba sqr
bb rnd
bc log
bd exp
be cos
bf sin
c0 tan
c1 atn
c2 peek
c3 len
c4 str$
c5 val
c6 asc
c7 chr$
c8 left$
c9 right$
ca mid$
------------------
cb go (Basic 2.0 and higher only)
ff pi
Extension Keywords (Tokens CC - FE)
The following codes are defined differently in each Basic version. The leftmost column shows VIC Super Expander commands (CC trough DD). Basic 3.5 and 7.0 differ in codes CE and FE, which are prefixes in 7.0, whereas in 3.5 CE = rlum and FE is unused.
Codes CC to D4 (3.5, 7.0 and 10.0) are function keywords, and D5 trough FA are action keywords.
Token Keyword
2.0 Super 4.0 3.5/7.0 10.0
cc key concat rgr rgr 2)
cd graphic dopen rclr rclr 2)
ce scnclr dclose rlum/*prefix* *prefix*
cf circle record joy joy
d0 draw header rdot rdot 2)
d1 region collect dec dec
d2 color backup hex$ hex$
d3 point copy err$ err$
d4 sound append instr instr
d5 char dsave else else
d6 paint dload resume resume
d7 rpot catalog trap trap
d8 rpen rename tron tron
d9 rsnd scratch troff troff
da rcolr directory sound sound
db rgr vol vol
dc rjoy auto auto
dd rdot pudef pudef
de graphic graphic
df paint paint 2)
e0 char char
e1 box box
e2 circle circle
e3 gshape paste 2)
e4 sshape cut 2)
e5 draw line
e6 locate locate 2)
e7 color color
e8 scnclr scnclr
e9 scale scale 2)
ea help help
eb do do
ec loop loop
ed exit exit
ee directory dir
ef dsave dsave
f0 dload dload
f1 header header
f2 scratch scratch
f3 collect collect
f4 copy copy
f5 rename rename
f6 backup backup
f7 delete delete
f8 renumber renumber
f9 key key
fa monitor monitor
--------------------------
fb using using
fc until until
fd while while
fe *prefix* *prefix*
Prefixed Extension Keywords (Tokens CE02 - CE0A)
The following codes implement function keywords. Basics 7.0 and 10.0 only.
Token Keyword
ce00
ce01
ce02 pot
ce03 bump
ce04 pen
ce05 rspos
ce06 rsprite
ce07 rspcolor
ce08 xor
ce09 rwindow
ce0a pointer
Prefixed Extension Keywords (Tokens FE02 - FE26)
The following codes are for 7.0 and 10.0 only. Keywords in the middle are commom.
Token Keyword
7.0 10.0
fe00
fe01
fe02 bank
fe03 filter
fe04 play
fe05 tempo
fe06 movspr
fe07 sprite
fe08 sprcolor
fe09 rreg
fe0a envelope
fe0b sleep
fe0c catalog
fe0d dopen
fe0e append
fe0f dclose
fe10 bsave
fe11 bload
fe12 record
fe13 concat
fe14 dverify
fe15 dclear
fe16 sprsav
fe17 collision
fe18 begin
fe19 bend
fe1a window
fe1b boot
fe1c width 2)
fe1d sprdef 2)
fe1e quit 1) 2)
fe1f stash dma
fe20
fe21 fetch dma
fe22
fe23 swap dma
fe24 off 1) 2)
fe25 fast
fe26 slow
fe27 type
fe28 bverify
fe29 ectory (diRectorY)
fe2a erase
fe2b find
fe2c change
fe2d set 3)
fe2e screen
fe2f polygon
fe30 ellipse
fe31 viewport 2)
fe32 gcopy 2)
fe33 pen
fe34 palette
fe35 dmode
fe36 dpat
fe37 pic 2)
fe38 genlock
fe39 foreground
fe3a
fe3b background
fe3c border
fe3d highlight
Notes:
1) Gives "unimplemented command error" on BASIC 7.0
2) Gives "unimplemented command error" on BASIC 10.0 v0.9
3) Only 'set def' is implemented.
---------------------------------
Third party products for VIC-20
Turtle Basic v1.0 Keywords
cc graphic
cd old
ce turn
cf pen
d0 draw
d1 move
d2 point
d3 kill
d4 write
d5 repeat
d6 screen
d7 doke
d8 reloc
d9 fill
da rtime
db base
dc pause
dd pop
de color
df merge
e0 char
e1 take
e2 sound
e3 vol
e4 put
e5 place
e6 cls
e7 accept
e8 reset
e9 grab
ea rdot
eb plr$
ec deek
ed joy
-------------------------------
Third party products for C=64
Simon's Basic Keywords
Token Keyword
6400
6401 hires
6402 plot
6403 line
6404 block
6405 fchr
6406 fcol
6407 fill
6408 rec
6409 rot
640a draw
640b char
640c hi col
640d inv
640e frac
640f move
6410 place
6411 upb
6412 upw
6413 leftw
6414 leftb
6415 downb
6416 downw
6417 rightb
6418 rightw
6419 multi
641a colour
641b mmob
641c bflash
641d mob set
641e music
641f flash
6420 repeat
6421 play
6422 >>
6423 centre
6424 envelope
6425 cgoto
6426 wave
6427 fetch
6428 at(
6429 until
642a >>
642b >>
642c use
642d >>
642e global
642f >>
6430 reset
6431 proc
6432 call
6433 exec
6434 end proc
6435 exit
6436 end loop
6437 on key
6438 disable
6439 resume
643a loop
643b delay
643c >>
643d >>
643e >>
643f >>
6440 secure
6441 disapa
6442 circle
6443 on error
6444 no error
6445 local
6446 rcomp
6447 else
6448 retrace
6449 trace
644a dir
644b page
644c dump
644d find
644e option
644f auto
6450 old
6451 joy
6452 mod
6453 div
6454 >>
6455 dup
6456 inkey
6457 inst
6458 test
6459 lin
645a exor
645b insert
645c pot
645d penx
645e >>
645f peny
6460 sound
6461 graphics
6462 design
6463 rlocmob
6464 cmob
6465 bckgnds
6466 pause
6467 nrm
6468 mob off
6469 off
646a angl
646b arc
646c cold
646d scrsv
646e scrld
646f text
6470 cset
6471 vol
6472 disk
6473 hrdcpy
6474 key
6475 paint
6476 low col
6477 copy
6478 merge
6479 renumber
647a mem
647b detect
647c check
647d display
647e err
647f out
Basic 4.0 Expansion for C64 defines codes CC trough DA like 4.0 above, but also a few more:
Token Keyword
db color
dc cold
dd key
de dverify
df delete
e0 auto
e1 merge
e2 old
e3 monitor
Speech Basic v2.7 Keywords (Tokens CC - E6)
Token Keyword
cc reset
cd basic
ce help
cf key
d0 himem
d1 disk
d2 dir
d3 bload
d4 bsave
d5 map
d6 mem
d7 pause
d8 block
d9 hear
da record
db play
dc voldef
dd coldef
de hex
df dez
e0 screen
e1 exec
e2 mon
e3 <-
e4 from
e5 speed
e6 off
-----------------------------------
c64 character generator
From : rmcwilson@delphi.com
You can adjust WHERE the computer "sees" the image for characters by
changing 2 memory locations:
1) $D018 (53272) Bits 1,2,3 can represent any even number 0-14.
This number represents the offset from the beginning of block of memory that the VIC chip is addressing. Example, you are using block 1 ($4000-$7fff) and you want your character data at 4K into the block. Set $DD00 to block 1, and then set only bit 2 in $D018. This will force the VIC to "see" the character dot data at 4K + 16384.
2) $DD00 (56576) This memory location selects which of the 4 blocks
(banks) of 16k video memory that the VIC chip addresses. These banks are numbered 0-3. Bits 0 and 1 of this location select this. You set these bits using this pattern:
Bank 0= 1 1
Bank 1= 1 0
Bank 2= 0 1
Bank 3= 0 0
A nice book which deals with all of this is: Mapping the 64 by Compute books.
--------------------------------
Comal
From : alan.jones@qcs.org
Someone asked what is the status of COMAL on the C64. The truth is "I don't know", but I'll tell you what I do know and think about Comal. I think Comal is the best programming language for the C64. I was fortunate to discover Comal shorlty after I bought my C64 and was totaly discusted with Basic. I was able to follow the Comal
language from Comal Today #1. It is a good learning language and a great development language.
As near as I can tell, Comal is dead, except on my desk and a few others. Len Lindsay, of the Comal Users Group USA, Ltd. published the Comal Today magazine issues 1-27. It has been several years since the last issue was published. Toward the end, Len made the mistake(?) that many in the Commodore community made. He tried to support the Comal language on other platforms, CP/M, Amiga, IBM PC, etc. to the detriment of C64/128 support. This was undoubtedly expensive and the loyal C64 users did not carry over to the other machines. The CP/M Comal was slow, the IBM Comals were too expensive. The Amiga Comal was pretty good and reasonably priced, but Amiga was not very popular and users had many other languages to choose from.
If Commodore USA had embraced Comal the way they embraced GEOS the world would be a better place today. Comal started in Demark and was more popular in the Danish and Dutch countries. I would expect it to still be in use over there but there were no replies from my inquirery about Comal on this international newsgroup, except for a few in the USA.
I started with Comal 0.14. This was a free disk loaded version that provided just under 10K of free memory. It took a long time to load on a stock C64/1541. Still, I prefered it instantly and I have not programmed in Basic since. Eventually there were updates that added more commands, fast loaders, and even provided more free memory. The full Comal language was the Comal 2.0 cartridge. This is a Unicomal product and was imported to the USA by the Comal Users Group USA, Ltd. They sold for about $100. It was 64K of ROM and provided almost 30K of free RAM. Comal 2.0 suported external procedures (like overlays) and machine language packages. The packages could be loaded into RAM or put onto ROM or EPROM and installed on the cartridge. I bought one of the first Comal 2.0 cartridges. This was a tan or grey cartridge
packed full with 4 16K EPROMS. These were made in the USA under licence from Unicomal. They would not hold package extensions. Later the Black cartridge was available, imported with three 32K sockets.
Two 32K ROMs contained the base Comal 2.0 system. A 16K "super chip" ROM was developed that contained many packages. There may have been a jumper for a 16K or 32K ROM or EPROM. I never had a black cartridge. It is possible to rewire a few traces on the tan cartidge to accecpt four 32K EPROMS and this is what I did. 128K!, an extra 64K for packages, or even Comal programs that can be loaded from the cartridge.
I think it can be expanded to use even more EPROM memory.
There was also a C128 cartridge available from Unicomal. It came with a full 128K of ROM. It provided 40K free and sold for about $200. I think hardly any were sold, although I would like to get one dirt cheap. The super chip had a 128 package that enabled use of many 128 features from 64 mode including fast mode, the 80 column screen even with graphics, screen dumps, windowing, etc., and use of the extra keys.
Power Driver was the last version of the disk loaded C64 Comal. Amazingly it added still more 2.0 like features and 15K of free RAM. It also had a "compiler". Comal is a three pass run time iterpreter. Did I forget to mention that Comal is fast? The "compiler" strips out the code needed only to reproduce the program listing, etc. and binds the program to the runtime module. A "compiled" program runs just as fast as the normal interpreted program but it makes 26K of free memory
available, for array storage etc., nearly as much as Comal 2.0. The "compiled" program is much larger but it can executed without having the Comal language, and of course freely distributed. The Power Driver was semi-free. It came "free" with the purchase of support package and was included on the later Comal Today disks. I think it is sharware now.
It should have been possible to develope a full 2.0 disk loaded version for the C128, but I don't think it was ever done. There was a disk loaded version developed for the Apple II.
I should also mention that Comal uses memory more efficiently than Basic. Comal reserves space for the high-res screen and packages. There are also "buffer" routines for using additional RAM, almost 8K additional for Power Driver, and 22K additional for Comal 2.0. Basic 2.0 has 39K available but you have to reduce that to use a high-res screen. I think GEOS only gives 24K of RAM.
One thing I had hoped to find is a true Ramdisk for the CBM REU. Maybe there is even a way to install RAMDOS for use with Comal. The REU can be used in direct access mode with Comal. But it would be wonderful to be able to load external procedures, packages, and chain programs from the REU.
The comal 2.0 cartridge banks in 16K of code at a time. The same amount and location that the REU can privide from its vacant socket. I wonder if there is someway to install Comal 2.0 in a modified REU?. Plugging an REU and cartridge into an expander board is a sensitive and fragile arrangement.
I think I would have been satisfied with the Power Driver and JiffyDOS If they had been available from the start. It certainly beats the heck out of Basic. And Comal 2.0 is very good, too many good features to list here. I think the best feature was Comal Today and the quality and diversity of the users who supported it.
I am not aware of the legal status of Comal. I expect the stuff is copyrighted but not available from any commercial source. Of course
anyone is free is develop a new implementation of Comal and market it. I am not aware of any Comal related files archived on the Internet, There may be Comal files on the commercial services and in club libraries.
There are many programming languages that the C64 can use. Comal, Forth, C, Pascal, Basic, Assembly, and others. On the C128 in CP/M mode there are other good choices. I believe in the philosophy of using the right language for the right task and programmer. Comal is often the best answer, but not always. I think Power C is good for programmers that are comfortable with it. Assembly language is good, but it is slow to program and requires more skill. Comal with packages written in Assembly language is an outstanding combination. Somone asked about Fortran on the C64. I think there are two C64 Fortran packages, but none that I would recommend. There are some acceptable Fortran compilers that will run on a C128 in CP/M mode, particularly Microsoft Fortran. There are even Comal programs that will translate source from Basic to Comal, and Comal to Fortran. Both leave more editing work to be done.
-------------------------
Comal..
From : Phil Heberer
Jerome Warburton writes:
JW> Just a few guestions about COMAL. Is there a C=128 version? Is the group that was doing the News letter still active? Are there any share ware programs that were written with it that you know of out there.
There *was* a C-128 COMAL cartridge produced, but it was imported from Denmark, and cost around $180 6-7 years ago! I have a COMAL cartridge that has what was called the "Super Chip" installed in an EPROM slot in the cartridge, and the Super Chip allows access to the 2 MHz speed and the 80 col screen when used on a 128/128D. I also have CP/M COMAL V2.10 that runs on the 128 in CP/M mode quite nicely.
As for Len Sindsay and the COMAL Today newsletter, I'm afraid they are long gone. :( The last issue I got was COMAL Today #24.
There were some shareware/PD things done in COMAL, and I have a few of those. I really think COMAL is a powerful, and easy-to-learn language, and it's a shame it never really caught on in this country. It was quite popular in England and the Scandinavian countries though.
JW> I may just have to pull it back out and see if I have better luck working with it these days.
I *used* to have a COMAL tutorial disk, but I loaned it to a relative newbie to make a copy of, and they formatted the wrong disk. :( As luck would have it, that was probbly the ONE disk I didn't have a backup of. I know a couple of people who have that disk, so I may be able to get a replacement soon. I have all the COMAL Today newsletters, and about every book ever written on it, so I'd be glad to help if I can.